package com.sds.shop.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;

import com.sds.fw.dao.AbDao;
import com.sds.shop.vo.CodeVO;
import com.sds.shop.vo.OrderVO;

public class OrderDAO extends AbDao {
	private static OrderDAO oDao = new OrderDAO();
	public static OrderDAO getInstance(){
		return oDao;
	}
	

	public ArrayList<OrderVO> getCList(){
		ArrayList<OrderVO> cList = new ArrayList<OrderVO>();
		Connection conn = null;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try{
			conn = connect();
			
			
			StringBuffer query = new StringBuffer();
			query.append("SELECT * from tb_order");
			
			ps = conn.prepareStatement( query.toString() );

			rs = ps.executeQuery();
			while(rs.next()){
				OrderVO ovo = new OrderVO();
			    ovo.setOrdNo(rs.getString(1));
			    ovo.setMemId(rs.getString(2));
			    
				cList.add(ovo);
			}
			close(conn, ps, rs);
		}catch(Exception ex){
			System.out.println("getCategoryList exception : " + ex);
			close(conn, ps, rs);
		}
		
		return cList;

	}

}
